#-*-encoding=utf-8-*-
@script_attr(permission='zope.View', use_template=True)
def setup():
    """安装程序

    这是应用的安装程序"""

    # 创建一个flowcenter
    flowcenter = deployApplet('default.flowcenter', context)
    IFlowCenter(flowcenter).categories1 = (u'文控流程',)
    IFlowCenter(flowcenter).categories2 = (u'其他流程',)


    flow = deploySpreadSheet(flowcenter, name='review', title='审核流程', 
                      edoclass='isodoc.review', workflow='isodoc.review')

    IDublinCore(flow).subjects = (u'文控流程', )

    flow = deploySpreadSheet(flowcenter, name='deliver', title='分发流程', 
                      edoclass='isodoc.delivery', workflow='isodoc.delivery')

    IDublinCore(flow).subjects = (u'文控流程', )

    flow = deploySpreadSheet(flowcenter, name='return', title='收回流程', 
                      edoclass='isodoc.return', workflow='isodoc.return')

    IDublinCore(flow).subjects = (u'文控流程', )

    flow = deploySpreadSheet(flowcenter, name='permission', title='文档权限申请流程', 
                      edoclass='isodoc.permission', workflow='isodoc.permission')

    IDublinCore(flow).subjects = (u'文控流程', )

    flow = deploySpreadSheet(flowcenter, name='destroy', title='文档销毁流程', 
                      edoclass='isodoc.destroy', workflow='isodoc.destroy')

    IDublinCore(flow).subjects = (u'文控流程', )

    request.response.redirect(absoluteURL(flowcenter, request))

